aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/[username]/transactions
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-13 23:18:40 -0700
committerAdam Soltys <[email protected]>2022-09-13 23:18:40 -0700
commit14a9420cc0e8f96e77beeacd02f7dcb44ff76134 (patch)
treef17d64d80e62470db4c563d830519fcbbd182482 /src/routes/[username]/transactions
parent328b987ca0b5bc3fadd4c43266775aece93e1df2 (diff)
downloadcoinos-ui-14a9420cc0e8f96e77beeacd02f7dcb44ff76134.tar.gz
coinos-ui-14a9420cc0e8f96e77beeacd02f7dcb44ff76134.zip
currency formatting helpers
Diffstat (limited to 'src/routes/[username]/transactions')
-rw-r--r--src/routes/[username]/transactions/+page.svelte10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/routes/[username]/transactions/+page.svelte b/src/routes/[username]/transactions/+page.svelte
index 9bc67fda..5a132394 100644
--- a/src/routes/[username]/transactions/+page.svelte
+++ b/src/routes/[username]/transactions/+page.svelte
@@ -2,6 +2,7 @@
import { AppHeader } from '$comp';
import { user, newPayment } from '$lib/store';
import { t } from '$lib/translations';
+ import { f, s } from "$lib/utils";
$newPayment = false;
@@ -28,16 +29,11 @@
<div class="grid grid-cols-3 border-b pb-5">
<div class="font-bold">
<span class="block mb-1"
- >{tx.amount > 0 ? '+' : ''}{new Intl.NumberFormat('en-US', {
- style: 'currency',
- currency: tx.currency
- }).format(tx.amount * (tx.rate / 100000000))}
+ >{tx.amount > 0 ? '+' : ''}{f(tx.amount * (tx.rate / 100000000), tx.currency)}
</span>
<span class="text-secondary"
- >{tx.amount > 0 ? '+' : ''}{new Intl.NumberFormat('en-US', {
- maximumFractionDigits: 0
- }).format(tx.amount)}
+ >{tx.amount > 0 ? '+' : ''}{s(tx.amount)}
SAT
</span>
</div>